package com.situ.vivamarket.model.front;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.situ.vivamarket.model.Goods;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;

/**
 * 购物车项
 */
@Setter
@Getter
@JsonIgnoreProperties("handler")
public class CartItem {
    private Integer id;
    private Integer memberId;//从session里拿
    @NotNull(message = "商品编号不能为空")
    private Integer goodsId;//商品编号
    @Min(value = 1,message = "购买商品至少为1")
    private Integer quantity;//购买的数量

    private Goods goods;//一对一关联查询

}
